import type { FormSchema } from '@/components/core/schema-form/';
import Upload from "@/components/basic/upload/index.vue";
import { UploadTypes } from "@/components/basic/upload/enums";
export interface KnowledgeBaseDto {
  id?: string;
  name: string;
  imageMD5?: string;
  active: boolean;
}

export const baseSchemas: FormSchema<KnowledgeBaseDto>[] = [
  {
    field: 'name',
    component: 'Input',
    label: '知识库名称',
    required: true,
    componentProps: {
      placeholder: '请输入知识库名称',
    },
  },
  {
    field: 'imageMD5',
    component: () => Upload,
    label: '知识库图片',
    required: false,
    helpMessage: '请上传图片',
    componentProps: {
      accept: UploadTypes.Image,
      vModelKey: 'modelValue',
      valueField: 'modelValue',
    },
    transform: (value) => value,
  },
  {
    field: 'active',
    component: 'Switch',
    label: '是否启用',
    defaultValue: true,
    componentProps: {
      checkedChildren: '启用',
      unCheckedChildren: '停用',
    },
  },
]; 